Integrand size = 29, antiderivative size = 127 \[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {b B \tan ^{1+m}(c+d x)}{d (1+m)}+\frac {(a A-b B) \operatorname {Hypergeometric2F1}\left (1,\frac {1+m}{2},\frac {3+m}{2},-\tan ^2(c+d x)\right ) \tan ^{1+m}(c+d x)}{d (1+m)}+\frac {(A b+a B) \operatorname {Hypergeometric2F1}\left (1,\frac {2+m}{2},\frac {4+m}{2},-\tan ^2(c+d x)\right ) \tan ^{2+m}(c+d x)}{d (2+m)} \]
b*B*tan(d*x+c)^(1+m)/d/(1+m)+(A*a-B*b)*hypergeom([1, 1/2+1/2*m],[3/2+1/2*m ],-tan(d*x+c)^2)*tan(d*x+c)^(1+m)/d/(1+m)+(A*b+B*a)*hypergeom([1, 1+1/2*m] ,[2+1/2*m],-tan(d*x+c)^2)*tan(d*x+c)^(2+m)/d/(2+m)
Time = 0.50 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.85 \[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {\tan ^{1+m}(c+d x) \left (\frac {b B}{1+m}+\frac {(a A-b B) \operatorname {Hypergeometric2F1}\left (1,\frac {1+m}{2},\frac {3+m}{2},-\tan ^2(c+d x)\right )}{1+m}+\frac {(A b+a B) \operatorname {Hypergeometric2F1}\left (1,\frac {2+m}{2},\frac {4+m}{2},-\tan ^2(c+d x)\right ) \tan (c+d x)}{2+m}\right )}{d} \]
(Tan[c + d*x]^(1 + m)*((b*B)/(1 + m) + ((a*A - b*B)*Hypergeometric2F1[1, ( 1 + m)/2, (3 + m)/2, -Tan[c + d*x]^2])/(1 + m) + ((A*b + a*B)*Hypergeometr ic2F1[1, (2 + m)/2, (4 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x])/(2 + m)))/d
Time = 0.46 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3042, 4075, 3042, 4021, 3042, 3957, 278}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^m (a+b \tan (c+d x)) (A+B \tan (c+d x))dx\) |
\(\Big \downarrow \) 4075 |
\(\displaystyle \int \tan ^m(c+d x) (a A-b B+(A b+a B) \tan (c+d x))dx+\frac {b B \tan ^{m+1}(c+d x)}{d (m+1)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^m (a A-b B+(A b+a B) \tan (c+d x))dx+\frac {b B \tan ^{m+1}(c+d x)}{d (m+1)}\) |
\(\Big \downarrow \) 4021 |
\(\displaystyle (a B+A b) \int \tan ^{m+1}(c+d x)dx+(a A-b B) \int \tan ^m(c+d x)dx+\frac {b B \tan ^{m+1}(c+d x)}{d (m+1)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (a A-b B) \int \tan (c+d x)^mdx+(a B+A b) \int \tan (c+d x)^{m+1}dx+\frac {b B \tan ^{m+1}(c+d x)}{d (m+1)}\) |
\(\Big \downarrow \) 3957 |
\(\displaystyle \frac {(a B+A b) \int \frac {\tan ^{m+1}(c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)}{d}+\frac {(a A-b B) \int \frac {\tan ^m(c+d x)}{\tan ^2(c+d x)+1}d\tan (c+d x)}{d}+\frac {b B \tan ^{m+1}(c+d x)}{d (m+1)}\) |
\(\Big \downarrow \) 278 |
\(\displaystyle \frac {(a A-b B) \tan ^{m+1}(c+d x) \operatorname {Hypergeometric2F1}\left (1,\frac {m+1}{2},\frac {m+3}{2},-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {(a B+A b) \tan ^{m+2}(c+d x) \operatorname {Hypergeometric2F1}\left (1,\frac {m+2}{2},\frac {m+4}{2},-\tan ^2(c+d x)\right )}{d (m+2)}+\frac {b B \tan ^{m+1}(c+d x)}{d (m+1)}\) |
(b*B*Tan[c + d*x]^(1 + m))/(d*(1 + m)) + ((a*A - b*B)*Hypergeometric2F1[1, (1 + m)/2, (3 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x]^(1 + m))/(d*(1 + m)) + ((A*b + a*B)*Hypergeometric2F1[1, (2 + m)/2, (4 + m)/2, -Tan[c + d*x]^2] *Tan[c + d*x]^(2 + m))/(d*(2 + m))
3.5.82.3.1 Defintions of rubi rules used
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[a^p*(( c*x)^(m + 1)/(c*(m + 1)))*Hypergeometric2F1[-p, (m + 1)/2, (m + 1)/2 + 1, ( -b)*(x^2/a)], x] /; FreeQ[{a, b, c, m, p}, x] && !IGtQ[p, 0] && (ILtQ[p, 0 ] || GtQ[a, 0])
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b/d Subst[Int [x^n/(b^2 + x^2), x], x, b*Tan[c + d*x]], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Tan[e + f*x])^m, x], x] + Simp[d/b Int [(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ[c^ 2 + d^2, 0] && !IntegerQ[2*m]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B *d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f* x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && !LeQ[m, -1]
\[\int \tan \left (d x +c \right )^{m} \left (a +b \tan \left (d x +c \right )\right ) \left (A +B \tan \left (d x +c \right )\right )d x\]
\[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )} \tan \left (d x + c\right )^{m} \,d x } \]
\[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int \left (A + B \tan {\left (c + d x \right )}\right ) \left (a + b \tan {\left (c + d x \right )}\right ) \tan ^{m}{\left (c + d x \right )}\, dx \]
\[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )} \tan \left (d x + c\right )^{m} \,d x } \]
\[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )} \tan \left (d x + c\right )^{m} \,d x } \]
Timed out. \[ \int \tan ^m(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int {\mathrm {tan}\left (c+d\,x\right )}^m\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right ) \,d x \]